#ifndef COMPARE_H
#define COMPARE_H

template<class T>
class Compare {
  public:
    virtual bool operator() (const T& p1, const T& p2) =  0;
};

// wheather p1 less than p2
template<class T>
class LtCompare : public Compare<T> {
  public:
    virtual bool operator() (const T& p1, const T& p2) { return p1 < p2;}
};

// wheather p1 greate than p2
template<class T>
class GtCompare : public Compare<T> {
  public:
    virtual bool operator() (const T& p1, const T& p2) { return p1 > p2;}
 };

#endif
